'use strict';

module.exports = {
  up: (queryInterface, Sequelize) => {
    return queryInterface.sequelize.transaction((t) => {
      return Promise.all([
          queryInterface.addColumn('CorporateEntityCategories', 'isDefault', {
              type: Sequelize.BOOLEAN,
              defaultValue: false,
          }, { transaction: t }),
          queryInterface.addColumn('CorporateEntities', 'isDefault', {
            type: Sequelize.BOOLEAN,
            defaultValue: false,
          }, { transaction: t }),
          queryInterface.addColumn('Roles', 'isNobody', {
            type: Sequelize.BOOLEAN,
            defaultValue: false,
          }, { transaction: t }),
          queryInterface.addColumn('Roles', 'isLogined', {
            type: Sequelize.BOOLEAN,
            defaultValue: false,
          }, { transaction: t }),
          queryInterface.addColumn('Roles', 'owner', {
            type: Sequelize.BOOLEAN,
            defaultValue: false,
          }, { transaction: t }),
         
      ])
    })
  },

  down: (queryInterface, Sequelize) => {
    return queryInterface.sequelize.transaction((t) => {
      return Promise.all([
        queryInterface.removeColumn('Roles', 'isNobody',
        { transaction: t }),
        queryInterface.removeColumn('Roles', 'isLogined',
        { transaction: t }),
        queryInterface.removeColumn('Roles', 'owner',
        { transaction: t }),
        queryInterface.removeColumn('CorporateEntities', 'isDefault',
        { transaction: t }),
        queryInterface.removeColumn('CorporateEntityCategories', 'isDefault',
        { transaction: t }),
      ])
    })
  }
};
